mui.init({
	beforeback: function() {
		//获得列表界面的webview  
		var list = plus.webview.currentWebview().opener();
		//触发列表界面的自定义事件（refresh）,从而进行数据刷新  
		mui.fire(list, 'refresh_method');
		//返回true，继续页面关闭逻辑  
		return true;
	}
})
$(function() {
	mui.ajax(user_url+'/api/selectOperator', {
		data: {},
		dataType: 'json', //服务器返回json格式数据
		type: 'post', //HTTP请求类型
		timeout: 10000, //超时时间设置为10秒；
		success: function(data) {
			//			console.log(JSON.stringify(data.resp))
			if(data.resp != 0) {
				var html = "";
				for(var i = 0; i < data.resp.length; i++) {
					html += '<li class="mui-table-view-cell">';
					html += data.resp[i].level_name + '<input type = "hidden" id = "level_money" value =' + data.resp[i].level_money + '>';
					html += '<input type = "hidden" id = "ida" value =' + data.resp[i].id + '>'
					html += '</li>';
				}
				$("#list").append(html);
			} else {
				mui.alert(data.msg)
			}
			$("#list li").click(function() {
				var level = $(this).text();
				var level_money = $(this).children("#level_money").val();
				var id = $(this).children("#ida").val();
				mui.openWindow({
					url: 'applicant_operator.html',
					id: 'applicant_operator',
					extras: {
						level: level,
						level_money: level_money,
						id_num: id
					},
					createNew: true
				});
			});
		},
		error: function(xhr, type, errorThrown) {
			//异常处理；
			console.log(type);
		}
	})
})